package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.domain.CompanyAddress;
import com.itheima.mapper.CompanyAddressMapper;
import com.itheima.service.ICompanyAddressService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 公司收发货地址表 服务实现类
 * </p>
 *
 * @author fukeke
 * @since 2022-11-11
 */
@DubboService
public class CompanyAddressServiceImpl extends ServiceImpl<CompanyAddressMapper, CompanyAddress> implements ICompanyAddressService {

    @Autowired
    private CompanyAddressMapper companyAddressMapper;

    //根据发货点公司地址id，查询发货点公司详情
    public CompanyAddress findCompanyAddressById(Long id) {
        return companyAddressMapper.selectById(id);
    }

    //获取所有收货地址
    public List<CompanyAddress> selectAll() {
        QueryWrapper<CompanyAddress> qw = new QueryWrapper<>();
        return companyAddressMapper.selectList(qw);
    }
}
